From 7c24bb1755c3d60f9120d8b7efafcca117c43873 Mon Sep 17 00:00:00 2001 From: "djm@kirby.fc.hp.com" Date: Mon, 2 May 2005 19:09:26 +0000 Subject: [PATCH] bitkeeper revision 1.1327.1.22 (42767ae6pMJH90d_vWODEW1wraCMTg) Oops, reenable swiotlb (more last round :-) --- .rootkeys | 1 + xen/arch/ia64/lib/Makefile | 2 +- xen/arch/ia64/patch/linux-2.6.11/swiotlb.c | 77 ++++++++++++++++++++++ xen/arch/ia64/tools/mkbuildtree | 24 +++---- xen/arch/ia64/xenmisc.c | 2 +- 5 files changed, 92 insertions(+), 14 deletions(-) create mode 100644 xen/arch/ia64/patch/linux-2.6.11/swiotlb.c diff --git a/.rootkeys b/.rootkeys index c18887a54a..f89bc459b4 100644 --- a/.rootkeys +++ b/.rootkeys @@ -1100,6 +1100,7 @@ 425ae516EWaNOBEnc1xnphTbRmNZsw xen/arch/ia64/patch/linux-2.6.11/processor.h 425ae516LecDyXlwh3NLBtHZKXmMcA xen/arch/ia64/patch/linux-2.6.11/series 425ae516RFiPn2CGkpJ21LM-1lJcQg xen/arch/ia64/patch/linux-2.6.11/setup.c +425ae516FX_10YaKGMU8Ysf7kkdm_A xen/arch/ia64/patch/linux-2.6.11/swiotlb.c 425ae516p4ICTkjqNYEfYFxqULj4dw xen/arch/ia64/patch/linux-2.6.11/system.h 425ae516juUB257qrwUdsL9AsswrqQ xen/arch/ia64/patch/linux-2.6.11/time.c 425ae5167zQn7zYcgKtDUDX2v-e8mw xen/arch/ia64/patch/linux-2.6.11/tlb.c diff --git a/xen/arch/ia64/lib/Makefile b/xen/arch/ia64/lib/Makefile index b5125f632b..a181d5166d 100644 --- a/xen/arch/ia64/lib/Makefile +++ b/xen/arch/ia64/lib/Makefile @@ -9,7 +9,7 @@ OBJS := __divsi3.o __udivsi3.o __modsi3.o __umodsi3.o \ bitop.o checksum.o clear_page.o csum_partial_copy.o copy_page.o \ clear_user.o strncpy_from_user.o strlen_user.o strnlen_user.o \ flush.o ip_fast_csum.o do_csum.o copy_user.o \ - memset.o strlen.o memcpy.o + memset.o strlen.o memcpy.o swiotlb.o default: $(OBJS) $(LD) -r -o ia64lib.o $(OBJS) diff --git a/xen/arch/ia64/patch/linux-2.6.11/swiotlb.c b/xen/arch/ia64/patch/linux-2.6.11/swiotlb.c new file mode 100644 index 0000000000..77fff5e2ec --- /dev/null +++ b/xen/arch/ia64/patch/linux-2.6.11/swiotlb.c @@ -0,0 +1,77 @@ + swiotlb.c | 21 +++++++++++++-------- + 1 files changed, 13 insertions(+), 8 deletions(-) + +Index: linux-2.6.11-xendiffs/arch/ia64/lib/swiotlb.c +=================================================================== +--- linux-2.6.11-xendiffs.orig/arch/ia64/lib/swiotlb.c 2005-04-08 12:13:54.040202667 -0500 ++++ linux-2.6.11-xendiffs/arch/ia64/lib/swiotlb.c 2005-04-08 12:19:09.170367318 -0500 +@@ -124,8 +124,11 @@ swiotlb_init_with_default_size (size_t d + /* + * Get IO TLB memory from the low pages + */ +- io_tlb_start = alloc_bootmem_low_pages(io_tlb_nslabs * +- (1 << IO_TLB_SHIFT)); ++ /* FIXME: Do we really need swiotlb in HV? If all memory trunks ++ * presented to guest as <4G, are actually <4G in machine range, ++ * no DMA intevention from HV... ++ */ ++ io_tlb_start = alloc_xenheap_pages(get_order(io_tlb_nslabs * (1 << IO_TLB_SHIFT))); + if (!io_tlb_start) + panic("Cannot allocate SWIOTLB buffer"); + io_tlb_end = io_tlb_start + io_tlb_nslabs * (1 << IO_TLB_SHIFT); +@@ -135,16 +138,16 @@ swiotlb_init_with_default_size (size_t d + * to find contiguous free memory regions of size up to IO_TLB_SEGSIZE + * between io_tlb_start and io_tlb_end. + */ +- io_tlb_list = alloc_bootmem(io_tlb_nslabs * sizeof(int)); ++ io_tlb_list = alloc_xenheap_pages(get_order(io_tlb_nslabs * sizeof(int))); + for (i = 0; i < io_tlb_nslabs; i++) + io_tlb_list[i] = IO_TLB_SEGSIZE - OFFSET(i, IO_TLB_SEGSIZE); + io_tlb_index = 0; +- io_tlb_orig_addr = alloc_bootmem(io_tlb_nslabs * sizeof(char *)); ++ io_tlb_orig_addr = alloc_xenheap_pages(get_order(io_tlb_nslabs * sizeof(char *))); + + /* + * Get the overflow emergency buffer + */ +- io_tlb_overflow_buffer = alloc_bootmem_low(io_tlb_overflow); ++ io_tlb_overflow_buffer = alloc_xenheap_pages(get_order(io_tlb_overflow)); + printk(KERN_INFO "Placing software IO TLB between 0x%lx - 0x%lx\n", + virt_to_phys(io_tlb_start), virt_to_phys(io_tlb_end)); + } +@@ -328,13 +331,13 @@ swiotlb_alloc_coherent(struct device *hw + */ + flags |= GFP_DMA; + +- ret = (void *)__get_free_pages(flags, order); ++ ret = (void *)alloc_xenheap_pages(get_order(size)); + if (ret && address_needs_mapping(hwdev, virt_to_phys(ret))) { + /* + * The allocated memory isn't reachable by the device. + * Fall back on swiotlb_map_single(). + */ +- free_pages((unsigned long) ret, order); ++ free_xenheap_pages((unsigned long) ret, order); + ret = NULL; + } + if (!ret) { +@@ -372,7 +375,7 @@ swiotlb_free_coherent(struct device *hwd + { + if (!(vaddr >= (void *)io_tlb_start + && vaddr < (void *)io_tlb_end)) +- free_pages((unsigned long) vaddr, get_order(size)); ++ free_xenheap_pages((unsigned long) vaddr, get_order(size)); + else + /* DMA_TO_DEVICE to avoid memcpy in unmap_single */ + swiotlb_unmap_single (hwdev, dma_handle, size, DMA_TO_DEVICE); +@@ -388,8 +391,10 @@ swiotlb_full(struct device *dev, size_t + * When the mapping is small enough return a static buffer to limit + * the damage, or panic when the transfer is too big. + */ ++#ifndef XEN + printk(KERN_ERR "PCI-DMA: Out of SW-IOMMU space for %lu bytes at " + "device %s\n", size, dev ? dev->bus_id : "?"); ++#endif + + if (size > io_tlb_overflow && do_panic) { + if (dir == PCI_DMA_FROMDEVICE || dir == PCI_DMA_BIDIRECTIONAL) diff --git a/xen/arch/ia64/tools/mkbuildtree b/xen/arch/ia64/tools/mkbuildtree index 0a60d12faf..5ffbd3efc8 100644 --- a/xen/arch/ia64/tools/mkbuildtree +++ b/xen/arch/ia64/tools/mkbuildtree @@ -142,7 +142,7 @@ softlink arch/ia64/lib/strlen_user.S arch/ia64/lib/strlen_user.S softlink arch/ia64/lib/strncpy_from_user.S arch/ia64/lib/strncpy_from_user.S softlink arch/ia64/lib/strnlen_user.S arch/ia64/lib/strnlen_user.S #softlink arch/ia64/lib/swiotlb.c arch/ia64/lib/swiotlb.c -#cp_patch arch/ia64/lib/swiotlb.c arch/ia64/lib/swiotlb.c swiotlb.c +cp_patch arch/ia64/lib/swiotlb.c arch/ia64/lib/swiotlb.c swiotlb.c softlink arch/ia64/lib/xor.S arch/ia64/lib/xor.S softlink lib/cmdline.c arch/ia64/cmdline.c @@ -151,19 +151,19 @@ softlink arch/ia64/hp/sim/hpsim.S arch/ia64/hpsim.S # xen/include/asm-generic files -softlink include/asm-generic/bug.h include/asm-generic/bug.h bug.h -softlink include/asm-generic/div64.h include/asm-generic/div64.h div64.h +softlink include/asm-generic/bug.h include/asm-generic/bug.h +softlink include/asm-generic/div64.h include/asm-generic/div64.h softlink include/asm-generic/errno.h include/asm-generic/errno.h softlink include/asm-generic/errno-base.h include/asm-generic/errno-base.h -softlink include/asm-generic/ide_iops.h include/asm-generic/ide_iops.h ide_iops.h -softlink include/asm-generic/iomap.h include/asm-generic/iomap.h iomap.h -softlink include/asm-generic/pci-dma-compat.h include/asm-generic/pci-dma-compat.h pci-dma-compat.h -softlink include/asm-generic/pci.h include/asm-generic/pci.h pci.h -softlink include/asm-generic/pgtable.h include/asm-generic/pgtable.h pgtable.h -softlink include/asm-generic/pgtable-nopud.h include/asm-generic/pgtable-nopud.h pgtable-nopud.h -softlink include/asm-generic/sections.h include/asm-generic/sections.h sections.h -softlink include/asm-generic/topology.h include/asm-generic/topology.h topology.h -softlink include/asm-generic/vmlinux.lds.h include/asm-generic/vmlinux.lds.h vmlinux.lds.h +softlink include/asm-generic/ide_iops.h include/asm-generic/ide_iops.h +softlink include/asm-generic/iomap.h include/asm-generic/iomap.h +softlink include/asm-generic/pci-dma-compat.h include/asm-generic/pci-dma-compat.h +softlink include/asm-generic/pci.h include/asm-generic/pci.h +softlink include/asm-generic/pgtable.h include/asm-generic/pgtable.h +softlink include/asm-generic/pgtable-nopud.h include/asm-generic/pgtable-nopud.h +softlink include/asm-generic/sections.h include/asm-generic/sections.h +softlink include/asm-generic/topology.h include/asm-generic/topology.h +softlink include/asm-generic/vmlinux.lds.h include/asm-generic/vmlinux.lds.h # xen/include/asm-ia64 files diff --git a/xen/arch/ia64/xenmisc.c b/xen/arch/ia64/xenmisc.c index 290b3296ab..335e7d16c3 100644 --- a/xen/arch/ia64/xenmisc.c +++ b/xen/arch/ia64/xenmisc.c @@ -33,7 +33,7 @@ void ia64_patch_vtop(unsigned long a, unsigned long b) { } void hpsim_setup(char **x) { } // called from mem_init... don't think s/w I/O tlb is needed in Xen -void swiotlb_init(void) { } +//void swiotlb_init(void) { } ...looks like it IS needed long is_platform_hp_ski(void) -- 2.30.2